# Maintainer: Oscar Fuentes <ofv@wanadoo.es>

_realname=aspell-es
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
_pkgver=1.11-2
pkgver=${_pkgver//-/.}
pkgrel=1
pkgdesc="Spanish dictionary for aspell (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64')
url="http://aspell.net/"
license=('custom')
depends=("${MINGW_PACKAGE_PREFIX}-aspell")
source=(https://ftp.gnu.org/gnu/aspell/dict/es/aspell6-es-${_pkgver}.tar.bz2
        001-unixy-dirs.patch)
sha256sums=('ad367fa1e7069c72eb7ae37e4d39c30a44d32a6aa73cedccbd0d06a69018afcc'
            '1e2680a4e6498e1a2eb4e0e1f52eac3c8b2d76627ab8df7bb36bdc686d814ad3')

prepare() {
  cd "${srcdir}/aspell6-es-${_pkgver}"
  patch -p1 -i ${srcdir}/001-unixy-dirs.patch
}

build() {
  cd "${srcdir}/aspell6-es-${_pkgver}"
  ./configure
  sed -i 's/C\:\\msys64\\/\//' Makefile
  make
}

package() {
  cd "${srcdir}/aspell6-es-${_pkgver}"
  make DESTDIR="${pkgdir}" install

  install -D -m644 Copyright "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}
